package com.mvc.web.common.utils;

import java.io.IOException;
import java.util.Properties;

import org.apache.log4j.Logger;

public class OSSConfigure {
	private static Logger logger = Logger.getLogger(PropertiesUtil.class);
	private static final Properties config;
	private static String endpoint;
	private static String accessKeyId;
	private static String accessKeySecret;
	private static String bucketName;
	private static String accessUrl;

	static {
		config = new Properties();
		try {
			config.load(PropertiesUtil.class.getClassLoader().getResourceAsStream("config_oss.properties"));
			endpoint = config.getProperty("endpoint").trim();
			accessKeyId = config.getProperty("accessKeyId").trim();
			accessKeySecret = config.getProperty("accessKeySecret").trim();
			bucketName = config.getProperty("bucketName").trim();
			accessUrl = config.getProperty("accessUrl").trim();
		} catch (IOException e) {
			logger.error(e.getMessage(), e);
		}
	}

	public static String getEndpoint() {
		return endpoint;
	}

	public static String getAccessKeyId() {
		return accessKeyId;
	}

	public static String getAccessKeySecret() {
		return accessKeySecret;
	}

	public static String getBucketName() {
		return bucketName;
	}

	public static String getAccessUrl() {
		return accessUrl;
	}

}
